package com.pureut.quality.controller;


import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.quality.service.QualityKanBanService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 品质看板
 * @author: CM
 * @date: 2023/5/8  14:41
 */
@RestController
@RequestMapping("/QualityKanBan")
public class QualityKanBanController extends BaseController {

    /**
     * 品质看板
     */
    @Resource
    private QualityKanBanService qualityKanBanService;

    /**
     * 检验单据统计
     */
    @GetMapping("/inspectionDocumentStatistics")
    public AjaxResult inspectionDocumentStatistics() throws Exception {
        return AjaxResult.success(qualityKanBanService.inspectionDocumentStatistics());
    }

    /**
     * 48小时内检验单据信息
     */
    @GetMapping("/inspectionHoursInfo")
    public AjaxResult inspectionHoursInfo() throws Exception {
        return AjaxResult.success(qualityKanBanService.inspectionHoursInfo());
    }

    /**
     * 待操作单据统计
     */
    @GetMapping("/documentStatics")
    public AjaxResult documentStatics() throws Exception {
        return AjaxResult.success(qualityKanBanService.documentStatics());
    }

    /**
     * 近7天合格率趋势
     */
    @GetMapping("/sevenDayYield")
    public AjaxResult sevenDayYield() throws Exception {
        return AjaxResult.success(qualityKanBanService.sevenDayYield());
    }

    /**
     * 近30天前五大不良
     */
    @GetMapping("/topFiveBad")
    public AjaxResult topFiveBad() throws Exception {
        return AjaxResult.success(qualityKanBanService.topFiveBad());
    }

}
